<?php include './admin/view/header.inc.htm'; ?>

<div class="panel">
	<div class="header">清理缓存</div>
	<div class="body">
		<form method="POST" action="admin/cache-clear.htm" id="form">
			<table class="form">
				<tr>
					<th>清理：</th>
					<td><label><input type="checkbox" name="clearcache" value="1" checked />所有缓存</label></td>
				</tr>
				<tr>
					<th>重建 maxid：</th>
					<td><label><input type="checkbox" name="rebuildmaxid" value="1" />重建 maxid</label> 耗费资源，请关闭站点，在流量低的时候执行。</td>
				</tr>
				<tr>
					<th>&nbsp;</th>
					<td colspan="2"><button type="submit" id="submit" loading-text="正在提交" class="blue big">确定清理</button></td>
				</tr>
			</table>
		</form>
	</div>
</div>

<?php include './admin/view/footer.inc.htm'; ?>

<script>
var jform = $("#form");
var jsubmit = $("#submit");
jform.on('submit', function(){
	var postdata = jform.serialize();
	jsubmit.button('loading');
	$.xpost(jform.attr('action'), postdata, function(code, message) {
		if(code == 0) {
			jsubmit.text(message);
			setTimeout(function() {jsubmit.button('reset');}, 1000);
			return false;
		} else {
			$.alert(message);
		}
		jsubmit.button('reset');
	});
	return false;
});
</script>